<template>
    <div class="box7">
        <div class="title">
            <p>年度游客量对比</p>
            <img src="../../images/dataScreen-title.png" alt="">
        </div>
        <div class="charts" ref="charts"></div>
    </div>
</template>

<script setup lang="ts">
import * as echarts from 'echarts';
import { ref, onMounted } from 'vue';
let charts = ref();
onMounted(() => {
    let mycharts = echarts.init(charts.value);
    mycharts.setOption({
        title: {
            text: '散点图',
            left: '40%',
            textStyle: {
                color: 'white'
            }
        },
        tooltip: {
            show:true,
        },
        xAxis: {
            type: 'category',
            splitLine: {
                show: false
            },
        },
        yAxis: {
            axisLine: {
                show: true
            },
            splitLine: {
                show: false
            },
        },
        grid: {
            left: 30,
            top: 35,
            right: 0,
            bottom: 20
        },
        series: {
            type: 'scatter',
            data: [40, 20, 50, 90, 77, 33, 22, 88, 67, 99, 90],
            //图标设置
            symbolSize:15,
            //图文标签
            label:{
                show:true,
                position:'top',
                color:'cyan'
            }
        }
    })
})
</script>

<style scoped>
.box7 {
    width: 100%;
    height: 100%;
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin: 10px 0px;

    .title {
        margin-left: 5px;

        p {
            color: white;
            font-size: 20px;
        }
    }

    .charts {
        height: calc(100% - 30px)
    }
}
</style>